package com.example.mapper;

import com.example.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author sword
 * @since 2021-03-26
 */
public interface RoleMapper extends BaseMapper<Role> {
    @Select("select r.* from role r,user_role ur where ur.role_id=r.id and ur.user_id=#{id}")
    List<Role> findRoleByUser(@Param("id") Integer id);
}
